﻿@model Dyd.Domain.Model.tb_order_return_config_model
@{
    ViewBag.Title = "添加tb_protocolversion";
    Layout = "~/Views/Shared/_LayoutPage.cshtml";
}

<div class="main_content">
    <div class="top">
        <h3 class="fl">@ViewBag.Title</h3>
        <a class="fr back" href="javascript:history.go(-1)">返回</a>
    </div>
    <div class="main mt10 pt10">
        <div class="fl edit2">
            @using (Html.BeginForm())
            {
			                                            <ul>
      	                    <li class="fm_item">
                        @Html.LabelFor(model => model.id)：
                        @Html.TextBoxFor(model => model.id, new { @maxlength = 4 })
                        @Html.ValidationMessageFor(model => model.id)
                    </li>
		                    <li class="fm_item">
                        @Html.LabelFor(model => model.serviceid)：
                        @Html.TextBoxFor(model => model.serviceid, new { @maxlength = 4 })
                        @Html.ValidationMessageFor(model => model.serviceid)
                    </li>
		                    <li class="fm_item">
                        @Html.LabelFor(model => model.version)：
                        @Html.TextBoxFor(model => model.version, new { @maxlength = 4 })
                        @Html.ValidationMessageFor(model => model.version)
                    </li>
		                    <li class="fm_item">
                        @Html.LabelFor(model => model.interfaceversion)：
                        @Html.TextBoxFor(model => model.interfaceversion, new { @maxlength = 8 })
                        @Html.ValidationMessageFor(model => model.interfaceversion)
                    </li>
		                    <li class="fm_item">
                        @Html.LabelFor(model => model.createtime)：
                        @Html.TextBoxFor(model => model.createtime, new { @maxlength = 8 })
                        @Html.ValidationMessageFor(model => model.createtime)
                    </li>
		                    <li class="fm_item">
                        @Html.LabelFor(model => model.protocoljson)：
                        @Html.TextBoxFor(model => model.protocoljson, new { @maxlength = 16 })
                        @Html.ValidationMessageFor(model => model.protocoljson)
                    </li>
		  
                    <li class="fm_item" style="margin-top: 10px;">
                        <p class="box">
                            <input id="btnSave" type="button" class="btn" value="保存" />
                        </p>
                    </li>
                </ul>
            }
        </div>
    </div>
</div>
@section Scripts{
    <script src="~/Scripts/jquery.validate.min.js"></script>
    <script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
    <script>
        $(function () {
            $("#btnSave").click(function () {
                if ($("form").valid()) {
                    var data = $("form").serialize();
                    $.ajax({
                        url: "/XX/XX/XXEdit",
                        type: "post",
                        data: data,
                        dataType: "json",
                        success: function (data) {
                            if (data.Flag) {
                                alert(data.Message);
                                window.location = "/XX/XX/XXIndex";
                            } else {
                                alert(data.Message);
                            }
                        }
                    });
                }
            });
        });
    </script>
}